﻿using Autofac;
using SheepStorage.Domain.Entity;
using SheepStorage.Repository.BaseImp;
using SheepStorage.Repository.Interface;
using System.Reflection;
using Module = Autofac.Module;

namespace SheepStorage.API.Filter
{
    public class AutofacModuleRegister: Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterAssemblyTypes(Assembly.Load("SheepStorage.Service"))
                .Where(a => a.Name.EndsWith("Service")).AsImplementedInterfaces();

                builder.RegisterAssemblyTypes(Assembly.Load("SheepStorage.Repository"))
                 .Where(a => a.Name.EndsWith("Repository")).AsImplementedInterfaces();


            

			builder.RegisterType<TokenService>();

        }


    }

 


	
}
